package com.web.main.entity.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @create 2020-11-22 15:06
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@ApiModel(value = "前端注册用户实体类")
public class AdminRegister implements Serializable {
    private static final long serialVersionUID = -2811036882147592362L;

    @ApiModelProperty(value = "账号（手机号）", required = true)
    @NotEmpty(message = "账号不能为空")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "账号是11为手机号")
    private String username;

    @ApiModelProperty(value = "密码", required = true)
    @NotEmpty(message = "密码不能为空")
    @Size(min = 6, max = 8, message = "密码长度应该在{min}~{max}之间")
    private String password;

    @ApiModelProperty(value = "姓名", required = true)
    @NotEmpty(message = "姓名不能为空")
    @Size(min = 2, max = 4, message = "姓名的长度应该在{min}~{max}之间")
    private String name;

}
